package com.juyu.miliao.api.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.core.RabbitTemplate.ConfirmCallback;
import org.springframework.amqp.rabbit.support.CorrelationData;

public class RabbitMQConfirmCallback implements ConfirmCallback{
	private final Logger confirmCallbackLogger = LoggerFactory.getLogger("rabbitMQConfirmCallback");

	@Override
	public void confirm(CorrelationData correlationData, boolean ack, String cause) {
		if(!ack){
			if(confirmCallbackLogger.isInfoEnabled()){
				confirmCallbackLogger.info("correlationData=" + correlationData + ", ack=" + ack + ", cause=" + cause);
			}
		}
	}

}
